home *** CD-ROM | disk | FTP | other *** search
/ United Public Domain Gold 4 / United Public Domain Gold 4.iso / fredfish / ff.0316.dms / ff.0316.adf / SmartIcon / src / romtraps.c < prev    next >
C/C++ Source or Header  |  1990-02-06  |  974b  |  51 lines

  1. #include <exec/types.h>
  2. #include <intuition/intuition.h>
  3. #include <intuition/intuisup.h>
  4. #include "patch.h"
  5.  
  6.  
  7. extern struct Window *theEventWindow;
  8.  
  9. extern ULONG          PatchSignal;
  10. extern struct Task   *PatchTask;
  11.  
  12. VOID
  13. MyOpenWindow(window)
  14. register struct   Window   *window;
  15. {
  16.    PatchWindow(window);
  17. }
  18.  
  19. VOID
  20. MyCloseWindow(window)
  21. register struct   Window  *window;
  22. {
  23.    register struct WindowPatch   *p;
  24.  
  25.    Forbid();
  26.    if (p = (struct WindowPatch *)FindWPatch(window))
  27.       UnPatchWindow(p, FALSE);
  28.    Permit();
  29. }
  30.  
  31. BYTE
  32. MyPutMsg(port, msg)
  33. register struct   MsgPort        *port;
  34. register struct   IntuiMessage   *msg;
  35. {
  36.    if (msg->Class==GADGETUP || msg->Class==GADGETDOWN)
  37.       {
  38.       register USHORT id = ((struct Gadget *)(msg->IAddress))->GadgetID;
  39.       if (id==ICONGADGET)
  40.          {
  41.          theEventWindow = msg->IDCMPWindow;
  42.          Signal(PatchTask, 1 << PatchSignal);
  43.          ReplyMsg(msg);
  44.          return(1);
  45.          }
  46.       }
  47.    return(0);
  48. }
  49.  
  50.  
  51.